{include file="header"}
<style>
    .layui-btn-danger{
        margin-left: 0;
    }
</style>
<div class="x-nav">
<!--           <span class="layui-breadcrumb">-->
<!--            <a href="">{:lang("system")}</a>-->
<!--            <a href="">TV管理</a>-->
            <a>
                <cite style="font-size: 18px;">TV列表</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" href="/" style="line-height:1.6em;margin-top:3px;float:right" title="返回主页">
        <i class="layui-icon" style="line-height:30px">返回主页</i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="parent.xadmin.open('添加作品名','{:url("Television/worksadd")}',600,300)"><i class="layui-icon"></i>添加作品名</button>
                </div>
                <div class="layui-card-body">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>作品名</th>
                            <th>添加时间</th>
                            <th>修改时间</th>
                            <th>{:lang('action')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="lists" id="item"}
                        <tr class="tr_{$item.id}">
                            <td>{$item.id}</td>
                            <td>{$item.name}</td>
                            <td>{$item.add_time}</td>
                            <td>{$item.update_time}</td>
                            <td>
                                <a href="javascript:;" class="rnglj" onclick="xadmin.open('添加剧集','{:url("Television/dramaadd",["id"=>$item["id"]])}')">添加剧集</a>&nbsp;&nbsp;|
                                <a href="javascript:;" class="rnglj" onclick="xadmin.open('查看剧集','{:url("Television/dramaall",["id"=>$item["id"]])}')">查看剧集</a>&nbsp;&nbsp;|
                                <a href="javascript:;" class="rnglj" onclick="xadmin.open('修改作品','{:url("Television/worksedit",["id"=>$item["id"]])}',600,300)">{:lang('edit')}</a>&nbsp;&nbsp;|
                                <a href="javascript:;" class="rnglj" onclick="del('{$item.id}')">{:lang('del')}</a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    {$lists|raw}
                </div>
            </div>
        </div>
    </div>
</div>

{include file="footer"}
<script>
    function del(id) {
        layer.confirm("{:lang('del.confirm')}",{icon: 3, title:'{:lang("tips")}'},function (index) {
            layer.close(index);
            request("POST",'{:url("television/worksdel")}',{
                id:id
            },function (res) {
                $(`.tr_${id}`).remove()
            })

        })
    }
</script>